<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增填报进度')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-progress-add">
            <!--<div class="form-group">
                <label class="col-sm-3 control-label is-required">会议安排ID：</label>
                <div class="col-sm-8">
                    <input name="arrangeId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">会议名称：</label>
                <div class="col-sm-8">
                    <input name="arrangeName" class="form-control" type="text" required>
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">会议名称：</label>
                <div class="col-sm-8">
                    <select name="arrangeId" id="arrangeId" class="form-control select2" onchange="hahaha();" required>
                        <option th:each="dict : ${conferenceArranges}" th:text="${dict.arrangeName}"
                                th:value="${dict.arrangeId}"></option>
                    </select>
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label is-required">接收人ID：</label>
                <div class="col-sm-8">
                    <input name="receiveUserId" class="form-control" type="text" required>
                </div>
            </div>-->
            <!--<div class="form-group">
                <label class="col-sm-3 control-label is-required">接收人：</label>
                <div class="col-sm-8">
                    <input name="receiveUser" class="form-control" type="text" required>
                </div>
            </div>-->
            <!--<div class="form-group">
                <label class="col-sm-3 control-label is-required">接收部门ID：</label>
                <div class="col-sm-8">
                    <input name="receiveDeptId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">接收部门：</label>
                <div class="col-sm-8">
                    <input name="receiveDept" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">接收时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="receiveTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">填报截止时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="lastFullTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">工作状态：</label>
                <div class="col-sm-8">
                    <label><input name="status" type="radio" value="0" />未填报 </label>
                    <label><input name="status" type="radio" value="1" />已填报</label>
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">接收人：</label>
                <div class="col-sm-3">
                    <div class="input-group">
                        <span class="input-group-addon"><a onclick="javaScript:chooseAllUser();">全员</a></span>
                        <span class="input-group-addon"><a onclick="javaScript:chooseUser();">选择</a></span>
                        <input id="releaseScope" name="releaseScope" class="form-control" type="text" required>
                        <span class="input-group-addon"><a onclick="javaScript:clearUser();">清空</a></span>
                    </div>

                </div>
                <label class="col-sm-2 control-label">参与人数：</label>
                <div class="col-sm-3">
                    <input id="total" name="total" class="form-control" type="number" unselectable="on" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">站内提示：</label>
                <div class="col-sm-8">
                    <label><input name="websiteTips" type="radio" value="0" />不提示 </label>
                    <label><input name="websiteTips" type="radio" value="1" />提示 </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">短信提示：</label>
                <div class="col-sm-8">
                    <label><input name="smsTips" type="radio" value="0" />不提示 </label>
                    <label><input name="smsTips" type="radio" value="1" />提示 </label>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" class="form-control" type="text">
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label is-required">发起人ID：</label>
                <div class="col-sm-8">
                    <input name="userId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发起人：</label>
                <div class="col-sm-8">
                    <input name="userName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发起人部门ID：</label>
                <div class="col-sm-8">
                    <input name="deptId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发起人部门：</label>
                <div class="col-sm-8">
                    <input name="deptName" class="form-control" type="text" required>
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "conference/progress"
        $("#form-progress-add").validate({
            focusCleanup: true
        });
            /*var arrangeId;
        //选中下拉框
        function hahaha() {
            var arrangeId= $("#arrangeId").find("option:selected").val();
            this.arrangeId=arrangeId;
        }*/
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-progress-add').serialize());
            }
        }

        $("input[name='receiveTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='lastFullTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        function chooseAllUser() {
            $("#releaseScope").val(page_constants.ALL_USER)
            $.ajax({
                type: "POST",
                url: ctx + "common/activeUserCount",
                error: function (request) {
                    $.modal.alertError("系统错误");
                },
                success: function (data) {
                    $("#total").val(data.data);
                }
            });
        }

        function chooseUser() {
            var arrangeId= $("#arrangeId").find("option:selected").val();
            $.modal.open("选择用户", ctx + "common/chooseUser1?arrangeId="+encodeURI(arrangeId));
        }

        function clearUser() {
            $("#releaseScope").val("");
            $("#total").val(0);
        }
    </script>
</body>
</html>